import { axios } from "@/utils/request";
import { baseUrl } from "@/services/baseUrl";

//【查询项目下拉框】
export function getPZGCProList(params) {
  return axios({
    url: baseUrl + "/mdata/sysProject/getPZGCProListByQX",
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//【查询项目-树】
export function getPZGCProTreeList(params) {
  return axios({
    url: baseUrl + "/mdata/sysProject/getPZGCProListTreeByQX",
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//项目级-数据统计
export function getProjectStaticTotal(params) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getProjectStaticTotal",
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//项目级-数据统计
export function getProjectStaticOrg(params) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getProjectStaticOrg",
    method: "GET",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    params,
  });
}

//企业级-统计头
export function getStaticHead(data) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getStaticHead",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 企业级-一级指标综合评分
export function getStaticFirst(data) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getStaticFirst",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 企业级-二级指标综合评分
export function getStaticTwo(data) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getStaticTwo",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 企业级-三级指标综合评分
export function getStaticThree(data) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getStaticThree",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}
// 企业级-数据明细
export function getStaticFirstDetail(data) {
  return axios({
    url: baseUrl + "/probusiness/qeStatistics/getStaticFirstDetail",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//项目申请-新增
export function saveProjectApprove(data) {
  return axios({
    url: baseUrl + "/probusiness/qeProjectApprove/save",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//项目申请-编辑
export function updateProjectApprove(data) {
  return axios({
    url: baseUrl + "/probusiness/qeProjectApprove/update",
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//项目申请-列表
export function getProjectApproveList(data) {
  let { page, pageSize } = data;
  return axios({
    url:
      baseUrl +
      `/probusiness/qeProjectApprove/getPageSet?pageNo=${page}&pageSize=${pageSize}&order=desc&sort=createTime`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//项目申请-详情
export function getProjectApproveDetail(data) {
  let { uuid } = data;
  return axios({
    url:
      baseUrl + `/probusiness/qeProjectApprove/getDetailByUuid?varchar=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}
//项目申请-删除
export function deleteProjectApprove(data) {
  let { uuid } = data;
  return axios({
    url: baseUrl + `/probusiness/qeProjectApprove/deleteBatch?varchar=${uuid}`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
  });
}

//项目申请-更新编辑状态
export function updateProApproveStatus(data) {
  return axios({
    url: baseUrl + `/probusiness/qeProjectApprove/updateProApproveStatus`,
    method: "POST",
    headers: {
      "Content-Type": "application/json;charset=UTF-8",
    },
    data,
  });
}

//项目申请-下载
export function reportDownLoad(params) {
  return axios({
    url: `/probusiness/qeProjectApprove/reportDownLoad`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params,
  });
}
